]> dgit.raspbian.org Git - gnome-shell.git/commit
lookingGlass: Stop using eval()
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 30 Nov 2018 15:57:47 +0000 (16:57 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Tue, 22 Jan 2019 21:33:46 +0000 (21:33 +0000)
commit467b7c1bcacebdcb90ba916651b5bcc897865e20
treef373f66f14a080cef91b66c3d0c253d82ec58f97
parent97963a1ca8105f3140444281d9aa393f029bada8
lookingGlass: Stop using eval()

Its use is not only strongly discouraged[0], we also rely on it injecting
variables into the global scope to get command-line-like behavior. That
behavior is incompatible with strict mode[1], and in extension with ES6
classes (which imply strict mode).

So to prepare for porting to ES6 classes, replace it with a somewhat less
evil construct that is compatible with strict mode.

[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Do_not_ever_use_eval!
[1]
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode#Simplifying_variable_uses

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/350
js/ui/lookingGlass.js